package apiday03homework;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo1 {
    public static void main(String[] args) {
        /*
        Collection<String> c = new ArrayList<>();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        boolean b = c.add("five");
        System.out.println(b);
        System.out.println(c);
        System.out.println("size:" + c.size());
        System.out.println("是否为空集：" + c.isEmpty());
        c.clear();
        System.out.println("是否为空集：" + c.isEmpty());

         */
        Collection<Integer> c = new ArrayList<>();
        c.add(1);
        c.add(2);
        c.add(3);
        c.add(4);
        c.add(5);
        System.out.println(c);

        c.add(1);
        System.out.println(c);

        c.clear();
        System.out.println(c.isEmpty());
    }
}
